distributions=c("normal",letters[1:18])
for(distribution in distributions){
	total.trial.results.dataframe=read.table(file=paste(distribution,"_trials.csv",sep=""),header=TRUE,sep=",")
	dcov.vs.b2=subset(total.trial.results.dataframe,Subset=="Best",select=c(B2.DCOV,B2.Rank.DCOV,B2))
	b2.plus.dcov.vs.b2.pval = as.numeric(t.test(dcov.vs.b2$B2.DCOV,dcov.vs.b2$B2,alternative=c("two.sided"),paried=TRUE,var.equal=FALSE,conf.level=.95)$p.val)
	b2.plus.rank.dcov.vs.b2.pval = as.numeric(t.test(dcov.vs.b2$B2.Rank.DCOV,dcov.vs.b2$B2,alternative=c("two.sided"),paried=TRUE,var.equal=FALSE,conf.level=.95)$p.val)
	significance = as.data.frame(cbind(distribution,b2.plus.dcov.vs.b2.pval,b2.plus.rank.dcov.vs.b2.pval))
	names(significance)=c("Distribution","B2plusDCOV","B2plusRankDCOV")
	if(distribution=="normal"){
		total.significance=significance		
		
	}else{
		total.significance=rbind(total.significance,significance)
	}
}
write.table(total.significance,file=paste("pvalues_paired-t-test_trials.csv",sep=""),sep=",",append=FALSE,row.names = FALSE)
